<?php 
namespace  api\modules\v1\controllers;

use yii\web\Controller;
use yii\rest\ActiveController;
use yii\filters\auth\HttpBasicAuth;
use yii\web\Response;
use frontend\models\Cat;

class CatController extends ActiveController{
	public $modelClass = 'frontend\models\Cat';

	public function behaviors(){
	    $behaviors = parent::behaviors();
	    $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_HTML;
	    return $behaviors;
	}

	//获取所有分类
	public function actionCatList(){
		$catModel=new Cat();

		return $catModel->getCatAll();

		// $catResource=$catModel::find()->asArray()->all(); 
		// return $catResource;	
	}




}












 ?>